package com.alinesno.cloud.portal.auto.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import com.alinesno.cloud.common.facade.orm.entity.BaseEntity;


/**
 * <p>
 * 
 * </p>
 *
 * @author WeiXiaoJin
 * @since 2019-11-21 07:41:47
 */
@Entity
@Table(name="auto_task")
public class AutoTaskEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 脚本内容
     */
	@Column(name="script_content")
	private String scriptContent;
    /**
     * 脚本类型(scala|ansible)
     */
	@Column(name="script_type")
	private String scriptType;
    /**
     * 任务名称
     */
	@Column(name="task_name")
	private String taskName;
    /**
     * 运行时间
     */
	@Column(name="task_run_time")
	private Integer taskRunTime;
    /**
     * 最后成功时间
     */
	@Column(name="last_success_time")
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	private Date lastSuccessTime;
    /**
     * 最后失败时间
     */
	@Column(name="last_fail_time")
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	private Date lastFailTime;

	/**
	 * 运行状态(0正常|1异常)
	 */
	private String runStatus ; 

	/**
	 * 任务版本
	 */
	private Integer taskVersion ; 

	/**
	 * 任务数量，默认为10个
	 */
	private int jobCount = 10 ;  

	public Integer getTaskVersion() {
		return taskVersion;
	}

	public void setTaskVersion(Integer taskVersion) {
		this.taskVersion = taskVersion;
	}

	public int getJobCount() {
		return jobCount;
	}

	public void setJobCount(int jobCount) {
		this.jobCount = jobCount;
	}

	public String getRunStatus() {
		return runStatus;
	}

	public void setRunStatus(String runStatus) {
		this.runStatus = runStatus;
	}

	public String getScriptContent() {
		return scriptContent;
	}

	public void setScriptContent(String scriptContent) {
		this.scriptContent = scriptContent;
	}

	public String getScriptType() {
		return scriptType;
	}

	public void setScriptType(String scriptType) {
		this.scriptType = scriptType;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public Integer getTaskRunTime() {
		return taskRunTime;
	}

	public void setTaskRunTime(Integer taskRunTime) {
		this.taskRunTime = taskRunTime;
	}

	public Date getLastSuccessTime() {
		return lastSuccessTime;
	}

	public void setLastSuccessTime(Date lastSuccessTime) {
		this.lastSuccessTime = lastSuccessTime;
	}

	public Date getLastFailTime() {
		return lastFailTime;
	}

	public void setLastFailTime(Date lastFailTime) {
		this.lastFailTime = lastFailTime;
	}


	@Override
	public String toString() {
		return "AutoTaskEntity{" +
			"scriptContent=" + scriptContent +
			", scriptType=" + scriptType +
			", taskName=" + taskName +
			", taskRunTime=" + taskRunTime +
			", lastSuccessTime=" + lastSuccessTime +
			", lastFailTime=" + lastFailTime +
			"}";
	}
}
